using System;
using System.Collections.Generic;
using System.Text;

using Channelvn.Cached;
using Channelvn.Cached.Base;
using Channelvn.Cached.Common;

namespace Channelvn.Cached.CacheObjects.ControlCached
{
    public class Home_Chuyen_Muc : HtmlControlCacheBase
    {
        public Home_Chuyen_Muc(CacheSettings.ControlSetting controlSetting)
            : base(controlSetting)
        {
        }

        protected override string ParentCategory
        {
            get
            {
                return Constants.PARENT_CATEGORY_FOR_NEWS_DETAIL_CACHE;
            }
        }

        protected override string CacheName
        {
            get 
            {
                return string.Format(Constants.CACHE_NAME_FORMAT_HTML_CONTROL_CONTENT, _controlSetting.ContainerID, Lib.QueryString.ZoneID, 0, 0, 0);
            }
        }

        protected override string CurrentCache
        {
            get
            {
                if (!string.IsNullOrEmpty(this._controlSetting.Category))
                {
                    return CacheController.Get<string>(this._controlSetting.Category, CacheName);
                }
                else
                {
                    return CacheController.Get<string>(Constants.PARENT_CATEGORY_FOR_NEWS_DETAIL_CACHE, CacheName);
                }
            }
        }
    }
}
